
####################################################################################################x
#klambda is a function to add dependence into the exponential draws via dependence
#in risk by event. The form of the event dependence is k*lambda_00
####################################################################################################
#risk1<-c(.09,.14,.16,.2,.11,.003,.01,.12,.16,1.2,1.02,2.4,.29,.76,49,.9,1.1,1.8,.09,.14,.16,.2,.11,.003,.01)
#risky2<-c(1.2, 1.2, 1.2, 1.2, 1.2, .02, .02, .02, .02, .02,.005,.005,.005)

klambda<- function(risk, k, rho=1)
{ #set.seed(1)
n <- length(risk)
timesbyk<-matrix(0,n,k)
for(i in 1:k){
timesbyk[,i]<-rexp(n,risk+((i-1)*risk))
}
if(rho==1) timesbyk<-matrix(rexp(n*k,rep(risk,k)),nrow=n)   
return(timesbyk)
} 


#output123<-klambda(risk,5,10)
#output123


